Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse query precedence ordering #9458

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

the-mikedavis
Copy link
Member

@the-mikedavis the-mikedavis commented Jan 28, 2024

This is a work in progress: we need to check the other tree-sitter queries (injections, indents, textobjects) and ensure that they also use the latest match. We also need to re-order and check all of the existing highlight queries. For now I've started small and only ported over Erlang's highlights.

Closes #9436

Progress
  • ada
  • adl
  • agda
  • astro
  • awk
  • bash
  • bass
  • beancount
  • bibtex
  • bicep
  • bitbake
  • blade
  • blueprint
  • c
  • cairo
  • capnp
  • cel
  • clojure
  • cmake
  • comment
  • common-lisp
  • cpon
  • cpp
  • crystal
  • c-sharp
  • css
  • cue
  • d
  • dart
  • dbml
  • devicetree
  • dhall
  • diff
  • docker-compose
  • dockerfile
  • dot
  • dtd
  • earthfile
  • ecma
  • edoc
  • eex
  • ejs
  • elixir
  • elm
  • elvish
  • env
  • erb
  • erlang
  • esdl
  • fidl
  • fish
  • forth
  • fortran
  • fsharp
  • gas
  • gdscript
  • gemini
  • git-attributes
  • git-commit
  • git-config
  • git-ignore
  • git-rebase
  • _gjs
  • gjs
  • gleam
  • glimmer
  • glsl
  • gn
  • go
  • godot-resource
  • gomod
  • gotmpl
  • gowork
  • graphql
  • groovy
  • gts
  • hare
  • haskell
  • haskell-persistent
  • hcl
  • heex
  • helm
  • hocon
  • hoon
  • hosts
  • html
  • hurl
  • hyprlang
  • iex
  • ini
  • inko
  • janet
  • java
  • _javascript
  • javascript
  • jinja
  • jsdoc
  • json
  • json5
  • jsonc
  • jsonnet
  • _jsx
  • jsx
  • julia
  • just
  • kdl
  • koka
  • kotlin
  • latex
  • ld
  • ldif
  • lean
  • ledger
  • llvm
  • llvm-mir
  • llvm-mir-yaml
  • log
  • lpf
  • lua
  • make
  • markdoc
  • markdown
  • markdown.inline
  • matlab
  • mermaid
  • meson
  • mojo
  • move
  • msbuild
  • nasm
  • nickel
  • nim
  • nix
  • nu
  • nunjucks
  • ocaml
  • ocaml-interface
  • odin
  • ohm
  • opencl
  • openscad
  • org
  • pascal
  • passwd
  • pem
  • perl
  • pest
  • php
  • php-only
  • pkgbuild
  • pkl
  • po
  • pod
  • ponylang
  • powershell
  • prisma
  • protobuf
  • prql
  • purescript
  • python
  • qml
  • r
  • racket
  • regex
  • rego
  • rescript
  • rmarkdown
  • robot
  • ron
  • rst
  • ruby
  • rust
  • sage
  • scala
  • scheme
  • scss
  • slint
  • smali
  • smithy
  • sml
  • solidity
  • spicedb
  • sql
  • sshclientconfig
  • starlark
  • strace
  • supercollider
  • svelte
  • sway
  • swift
  • t32
  • tablegen
  • tact
  • task
  • tcl
  • templ
  • tfvars
  • todotxt
  • toml
  • tsq
  • tsx
  • twig
  • _typescript
  • typescript
  • typst
  • ungrammar
  • unison
  • uxntal
  • v
  • vala
  • verilog
  • vhdl
  • vhs
  • vue
  • wast
  • wat
  • webc
  • wgsl
  • wit
  • wren
  • xit
  • xml
  • xtc
  • yaml
  • yuck
  • zig

TODO: also verify locals, indents

@the-mikedavis the-mikedavis added A-tree-sitter Area: Tree-sitter S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-language-support Area: Support for programming/text languages labels Jan 28, 2024
@pascalkuthe
Copy link
Member

pascalkuthe commented Jan 28, 2024

dump question: couldn't we simply write a script that reads all queries and reverses all lines?

It would be ugly but at least trivially correct.

@the-mikedavis
Copy link
Member Author

It would probably be a little tricky to write so that it handles comments correctly but yeah that would be the most efficient way

@archseer
Copy link
Member

There's also files that were copied and weren't properly reversed in the first place

the-mikedavis and others added 6 commits May 17, 2024 20:27
…cedence order

This commit adapts PureScript highlight queries to match upcoming changes in Helix which will make queries matching order go from more to general to more specific, the opposite of previous order.
Update julia parser to latest version, along with:
- updating the queries,
- pulling changes from `nvim-treesitter`’s queries (as the maintainters
  of the parser update the queries there),
- reversing the queries’ order to be compatible with upstream.
@archseer archseer force-pushed the reverse-query-precedence-ordering branch from 17bb6b4 to 951b454 Compare May 17, 2024 11:32
@archseer archseer added this to the next milestone May 20, 2024
@archseer
Copy link
Member

I added a progress checklist to the PR description. I'm going through these one by one and comparing them to the nvim-treesitter ordering: in many cases there's nothing to do or the file wasn't correctly reordered in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages A-tree-sitter Area: Tree-sitter S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reverse tree-sitter query precedence ordering
6 participants